package com.team1.supervend.state_machine;

public class AcceptingCustomerOrderState implements State {

    SuperVend superVend;
    
    public AcceptingCustomerOrderState(SuperVend superVend) {
        this.superVend = superVend;
    }

	@Override
	public void startSale() {
		System.out.println("startSale                   -- AcceptingCustomerOrderState -- do nothing");
	}

	@Override
	public void cancelSale() {
		System.out.println("cancelSale                  -- AcceptingCustomerOrderState -- do nothing");
	}

	@Override
	public void endSale() {
		System.out.println("endSale                     -- AcceptingCustomerOrderState -- do nothing");
	}

	@Override
	public void returnToIdle() {
		System.out.println("returnToIdle                -- AcceptingCustomerOrderState -- do nothing");
	}

	@Override
	public void preValidatePayment() {
		System.out.println("preValidatePayment          -- AcceptingCustomerOrderState -- do nothing");
	}

	@Override
	public void payBalance() {
		System.out.println("payBalance                  -- AcceptingCustomerOrderState -- do nothing");
	}

	@Override
	public void cancelPayment() {
		System.out.println("cancelPayment               -- AcceptingCustomerOrderState -- do nothing");
	}

	@Override
	public void chooseCashPayment() {
		System.out.println("chooseCashPayment           -- AcceptingCustomerOrderState -- do nothing");
	}

	@Override
	public void insertMoney(float denomination) {
		System.out.println("insertMoney                 -- AcceptingCustomerOrderState -- do nothing");
	}

	@Override
	public void makeCashPayment() {
		System.out.println("makeCashPayment             -- AcceptingCustomerOrderState -- do nothing");
	}

	@Override
	public void supplyCreditCardInformation() {
		System.out.println("supplyCreditCardInformation -- AcceptingCustomerOrderState -- do nothing");
	}

	@Override
	public void paymentAuthorized() {
		System.out.println("paymentAuthorized           -- AcceptingCustomerOrderState -- do nothing");
	}

	@Override
	public void allowProductSelection() {
		System.out.println("allowProductSelection       -- AcceptingCustomerOrderState -- do nothing");
	}

	@Override
	public void chooseProduct(int quantity) {
		System.out.println("chooseProduct("+quantity+")");
		if ( quantity > 0 ) {
			System.out.println("quantity > 0");
		}
		else{
			System.out.println("quantity = 0");
			superVend.setState(superVend.getProcessingSaleState());
		}
	}

	@Override
	public void productSelectionComplete() {
		System.out.println("productSelectionComplete");
		superVend.setState(superVend.getProcessingSaleState());
	}

	public String toString() {
		return "AcceptingCustomerOrderState";
	}
}
